Implement automatic auth token checking#482
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request implements automatic auth token checking by introducing a new configuration function and integrating a background task to validate token sessions.
- Adds a new method in the configuration for auto-checking of auth session cookies.
- Refactors the token authorisation command cog and introduces a background task cog to regularly check token validity.
- Updates the module imports accordingly.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| config.py | Adds _setup_auto_auth_session_cookie_checking to validate and convert env var values into a timedelta. |
| cogs/get_token_authorisation.py | Refactors token authorisation logic, standardizes command implementation, and adds a background task cog. |
| cogs/init.py | Adjusts imports to include the new TokenAuthorisationCheckTaskCog. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds automatic checking of the SU platform access cookie’s validity and permissions, both on demand and as a background task.
- Introduces two new config setups for enabling auto-checking and parsing its interval.
- Extracts authorisation logic into a shared
TokenStatusenum and helper methods, and adds separate command and background task cogs. - Registers the new Task Cog in
cogs/__init__.py.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| config.py | Added _setup_auto_su_platform_access_cookie_checking and interval parsing. |
| cogs/check_su_platform_authorisation.py | Created TokenStatus, get_token_status, get_token_groups, command & task cogs. |
| cogs/init.py | Imported and registered CheckSUPlatformAuthorisationTaskCog. |
Comments suppressed due to low confidence (1)
config.py:485
- [nitpick] The variable name
raw_auto_auth_session_cookie_checkingis ambiguous and inconsistent with the method name. Consider renaming it toraw_auto_su_platform_access_cookie_checkingfor clarity.
raw_auto_auth_session_cookie_checking: str = str(
CarrotManMatt
requested changes
Jul 5, 2025
Co-authored-by: Matt Norton <matt@carrotmanmatt.com> Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com>
Member
Author
|
quite annoyingly I can't actually test if these changes have broken anything cos we don't know if anyone has a working token |
Member
|
Indeed🙁 |
CarrotManMatt
requested changes
Jul 5, 2025
CarrotManMatt
requested changes
Jul 5, 2025
Co-authored-by: Matt Norton <matt@carrotmanmatt.com> Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com>
CarrotManMatt
approved these changes
Jul 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.